//
//  CoreTextLabel.h
//  IfengNews
//
//  Created by 侯 甲 on 13-8-22.
//
//

#import <UIKit/UIKit.h>
#import <CoreText/CoreText.h>
#import "CLDocumentModel.h"
@class INHtmlElement;

@interface CoreTextLabel : UIView

@property(nonatomic,strong)UIFont *textFont;
@property(nonatomic,assign)CGFloat textFontSize;
@property(nonatomic,strong)CLDocumentModel *documentModel;

/**
 * @abstract 下面两个对象，只会存在一个。一个有，另一个则为nil。
 * @discussion 先定字体，最后设置“_textAttribute”属性；“_element”则无所谓，因为都不起作用。
        属性字符串完事以后，必须调用 "- textAttributeComplete"方法
 * @updated by 20130823
 * @author HouJia
 * @note 需要什么自己加吧
 */
@property(nonatomic,strong)NSMutableAttributedString *textAttribute;
@property(nonatomic,strong)INHtmlElement *element;

- (NSAttributedString *)setTextAttribute:(NSString *)string withFont:(UIFont *)font
                           withFontColor:(UIColor *)fontColor;

- (NSAttributedString *)appendTextAttribute:(NSString *)string withFont:(UIFont *)font
                              withFontColor:(UIColor *)fontColor;
- (void)textAttributeComplete;

- (CGFloat)textLabelHeightWithSelfBounds;

- (CTFrameRef)ctFrameRef;

@end
